package com.itheima.sh.feign.order;

import com.itheima.sh.entity.OrderEntity;
import com.itheima.sh.feign.order.fallback.OrderFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * @Description:
 * @Version: V1.0
 */
@FeignClient(value = "order-service", fallback = OrderFeignFallback.class)
public interface OrderFeign {


    //http://localhost:9001/order/findOrderInfoByUserId/1

    @GetMapping("/order/findOrderInfoByUserId/{userId}")   // SpringMvc  Feign 增强
    public List<OrderEntity> findOrderInfoByUserId(@PathVariable("userId") Integer userId);


    @PostMapping("/order/findAll")
    public String findAll();
}
